
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>人工干预-登录</title>
  <link rel="stylesheet" href="../css/element.css">
	<link rel="stylesheet" href="../css/common.css">
  <link rel="stylesheet" href="../css/login.css">
  
</head>

<body>
	<div id="app" v-cloak style="background: url(../images/login_bg2.jpg) top center no-repeat;padding:20px;">
       
           <div>
            <img src="../images/logo.png">
           </div>
            
           <p class="big_title">登 录</p>
           <el-card>

             <div slot="header" class="clearfix">
               <span class="font22 gray">Login</span>
             </div>

             <el-input
              placeholder="用户名"
              v-model="userName">
              <i slot="prefix" class="el-input__icon el-icon-menu"></i>
            </el-input>

            <el-input
              placeholder="密码"
              v-model="passWord"
              type="password"
              >
              <i slot="prefix" class="el-input__icon el-icon-info"></i>
            </el-input>

            <el-button type="success" round @click="login">登录</el-button>
           </el-card>
    </div>
</body>
    <script src="../js/vue.js"></script>
    <script src="../js/element.js"></script>
    <script src="../js/axios.min.js"></script>
    <script src="../js/md5.js"></script>
  	<script>
      if(localStorage.sys_userId){
        window.location.href = './dataquery/complex.html';
      }
  	  var app = new Vue({
  	      el: '#app',
          data(){
            return{
              maskShow:false,
              userName:'',
              passWord:''
              
            }
          },
          mounted:function(){//获取行业
             // axios
             // .get(Common.GET_INDUSTRY_URL)
             // .then((res)=>{
             //   this.industry_info = res.data.data;
             // });
             // var hash = hex_md5("input string");
             // console.log(hash);
          },
          methods:{
              login:function(){
                if(!this.userName){
                  this.$message.error('用户名不能为空');
                }else if(!this.passWord){
                  this.$message.error('密码不能为空');
                }else{
                  var mdPWD = hex_md5(this.passWord).toUpperCase();
                  axios
                   .get(`https://goldeye.cfbond.com/cmsys/user_login?login_name=${this.userName}&pwd=${mdPWD}`)
                   .then((res)=>{
                     if(!res.data.flag){
                      this.$message.error(res.data.message);
                     }else{
                      this.$message('登陆成功！');
                      localStorage.sys_userName = res.data.data.user_name;
                      localStorage.sys_userId = res.data.data.user_id;
                      localStorage.sys_sessionId = res.data.data.session_id;
                      window.location.href="./dataquery/complex.html";
                     }
                   });
                }
              }
          }
  	  });
  	</script>

</html>